<template>
  <div class="fix-width-frame">
    <el-row class="f-mt20">
          <el-col :span="12" :offset="2" class="user">
            欢迎您回来！
          </el-col>
    </el-row>

    <el-row class="f-mt20">
        <el-col :span="12" :offset="2">
            您的账户余额：<span style="color:red">{{formData.balance / 100}}</span>

            <el-button type="text" class="deposit" @click="toDeposit()">积分充值>></el-button>

        </el-col>
    </el-row>
  </div>
</template>

<script>
    import {getUserAccount} from '@/api/myinfo'
    export default {
      data () {
        return {
          city: {},
          formData: {
            balance: ''
          },
          rules: {

          }
        }
      },
      mounted () {
        // this.initData();
        this.init()
  },
      methods: {
        async init () {
          try {
            // const account = await getAccount();
            const result = await getUserAccount()
            if (result.status === 200 && result.data.code === 200) {
              let data = result.data
              this.formData.balance = data.data.balance
            }
          } catch (err) {
            console.log(err)
          }
        },
        async initData () {
    
        },
    
        toDeposit () {
          this.$router.push('points')
        }
  }
    }
</script>

<style lang="less" scoped>
    @import '../../style/mixin';
    .fix-width-frame {
      margin: 0 auto;
      width: 1000px;
    }
    .user{
        color: #FF4B00;
        font-weight: bold;
    }

    .deposit {
        margin-left: 10px;
    }
</style>
